<!DOCTYPE html>
<html>
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
  <meta name="format-detection" content="telephone=no" />
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <title>嘿~不一样的柬埔寨~</title>
  <link rel='stylesheet' href='stylesheets/index.css' />
  <link rel='stylesheet' href='stylesheets/tv.css' />
  <link rel='stylesheet' href='stylesheets/alertPlus.css' />
  <script>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?ce129bd0ca0e2419e8e1388fbc840494";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>
</head>
<body>
  <div class="container">
    <div class="show-tv-info">
      <img src="images/1.png" alt="" class="img-eye">
      <video playsinline="" webkit-playsinline="" preload="auto" id="video-jpz" poster="images/tv_1.png" src="http://vodcdn.video.taobao.com/oss/taobao-ugc/b80981fa7ce74cb4a74366f0d26d2fd0/1480420626/video.mp4"></video>
      <img src="images/tip_1.png" alt="" class="tv-intro">
      <img src="images/watch_app.png" alt="" class="tv-watch-app">
      <img src="images/share_friend.png" alt="" class="tv-share-btn">
    </div>
    <section class="sec-comments">
      <p class="p-sec-title">评论</p>
      <div class="box-input">
          <input type="text" class="ipt-comment" id="ipt-comment" placeholder="我也来说一句：">
        <button class="btn-send">发送</button>
      </div>
      <button class="btn-new-msg hide">有新的评论，点击查看</button>
      <div class="comments-list">
      <% if(rows.length!=0){
      rows.forEach(function(el) {%>
        <div class="box-comment" value="<%=el.id%>" nickname="<%=el.user.nickName%>">
          <div class="box-comment-usr">
            <img src="<%=el.user.avatar%>" alt="" class="img-comment-avatar">
            <div class="box-comment-nick">
              <p class="p-comment-name"><%=el.user.nickName%>
              <%if(el.targetUser!=null){%>
              <span class="color-grey"> 回复 </span><span><%=el.targetUser.nickName%></span>
              <%}%>
            </p>
              <p class="p-comment-time"><%=el.dateTime%></p>
            </div>
          </div>
          <div class="box-comment-main">
            <p class="p-comment-main"><%=el.content%></p>
          </div>
        </div>
      <%})}%>
    </div>
    <button class="btn-more-comments">查看更多评论</button>
    </section>
    <div class="bg-shandow">
      <img src="images/share_cover.png" alt="" width="100%">
    </div>
  </div>
</body>
<script src="javascripts/jquery-1.10.1.min.js" charset="utf-8"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script src="javascripts/iphone-inline-video.browser.js"></script>
<script src="javascripts/alertPlus.js" charset="utf-8"></script>
<script type="text/javascript">
var id = '<%=id%>';
$('.tv-intro').attr('src','images/tip_'+id+'.png');
var video = $('#video-jpz').get(0);
makeVideoPlayableInline(video);
$('#video-jpz').attr('poster','images/tv_'+id+'.png');
$('#video-jpz').on('click',function () {
  var tv = document.getElementById('video-jpz');
  tv.play();
})

//改变视频链接
if(id == 1){
  $('#video-jpz').attr('src','http://video.lalocal.cn/video/mp4/201612071001.mp4');
}else if(id == 2){
  $('#video-jpz').attr('src','http://video.lalocal.cn/video/mp4/201612071009.mp4');
}else if (id == 3) {
  $('#video-jpz').attr('src','http://video.lalocal.cn/video/mp4/201612071011.mp4');
}else if(id == 4){
  $('#video-jpz').attr('src','http://video.lalocal.cn/video/mp4/201612071005.mp4');
}else if(id == 5){
  $('#video-jpz').attr('src','http://video.lalocal.cn/video/mp4/201612071007.mp4');
}else if(id == 6){
  $('#video-jpz').attr('src','http://video.lalocal.cn/video/mp4/201612071003.mp4');
}else if(id == 7){
  $('#video-jpz').attr('src','http://video.lalocal.cn/video/mp4/201612071002.mp4');
}else if(id == 8){
  $('#video-jpz').attr('src','http://video.lalocal.cn/video/mp4/201612071008.mp4');
}else if(id == 9){
  $('#video-jpz').attr('src','http://video.lalocal.cn/video/mp4/201612071006.mp4');
}


var shareData = {
  title : '吃蜘蛛看蝙蝠裹睡衣等日出，直播够happy！',
  desc : '乐可旅行带你玩转柬埔寨：俊男美女主播深入小众景点。大吃蜘蛛暴走集市，别样当地风情，更多精彩直播视频不容错过 ~',
  imgUrl : '<%=browserURL%>/images/share_jpz.jpg',
  link : '<%=browserURL%>/show'
};

var wxConfig = {
  appId : '<%=wxConfig.appId%>',
  timestamp : '<%=wxConfig.timestamp%>',
  nonceStr : '<%=wxConfig.nonceStr%>',
  signature : '<%=wxConfig.signature%>'
}

var wxUserInfo = {};

</script>
<script src="javascripts/base.js?v=1.0" charset="utf-8"></script>
<script>
if(location.href.charAt(4) == 's' && !isWechat()){
  console.log('这不是微信环境，且这是个https请求');
  var thisUrl = window.location.href.split('openid')[0];
  console.log(thisUrl);
  window.location.href = 'http'+thisUrl.substring(5);
}
var totalRows = <%=totalRows%> || 10;
var totalPages = <%=totalPages%> || 1;
var targetType = <%=commentInfo.type%>;
var targetId = <%=commentInfo.id%>;
var userInfo = sessionStorage.getItem('userInfo');
var info = JSON.parse(userInfo);
if(isWechat()){
  wxUserInfo.nickname = info.nickname;
  wxUserInfo.headimgurl = info.headimgurl;
  wxUserInfo.openid = info.openid;
  wxUserInfo.unionid = info.unionid;
}
</script>
<script src="javascripts/ajax_wechat.js" charset="utf-8"></script>
<script src="javascripts/tv.js" charset="utf-8"></script>
</html>
